 <?php
ob_start();
date_default_timezone_set('Asia/Bangkok');
include("../connect.php");
		
//	  $txtEmployee_id1 = $_POST["txtEmployee_id1"];
//	  	  echo "<script language='javascript'>
//			   alert('$txtEmployee_id1');
//			  </script>";
//		 $mail_id = $_POST["mail_id"];
//		  echo "<script language='javascript'>
//			   alert('$mail_id');
//			  </script>";
//	  $datemail_authorized = $_POST["datemail_authorized"];
//		  echo "<script language='javascript'>
//			   alert('$datemail_authorized');
//			  </script>";
//	  $datemail_requestUser = $_POST["datemail_requestUser"];
//	  	  echo "<script language='javascript'>
//			   alert('$datemail_requestUser');
//			  </script>";
//	  $datemail_staffIT = $_POST["datemail_staffIT"];	  
//	  	  echo "<script language='javascript'>
//			   alert('$datemail_staffIT');
//			  </script>";
//	  $datemail_authorizedCon = $_POST["datemail_authorizedCon"];
//	  	  echo "<script language='javascript'>
//			   alert('$datemail_authorizedCon');
//			  </script>";
//	  $datemail_supervisor = $_POST["datemail_supervisor"];
//	  	  echo "<script language='javascript'>
//			   alert('$datemail_supervisor');
//			  </script>";
		
	  $datemail_authorized =date('Y-m-d H:i:s', strtotime($datemail_authorized));
	  $datemail_requestUser =date('Y-m-d H:i:s', strtotime($datemail_requestUser));
	  $datemail_staffIT =date('Y-m-d H:i:s', strtotime($datemail_staffIT));
	  $datemail_authorizedCon =date('Y-m-d H:i:s', strtotime($datemail_authorizedCon));
	  $datemail_supervisor =date('Y-m-d H:i:s', strtotime($datemail_supervisor));
	

	  $datemail_authorized1 =date('Y-m-d', strtotime($datemail_authorized));
	  $datemail_authorized2 = date('H:i:s', strtotime($datemail_authorized));
	  $datemail_authorized3 = $datemail_authorized1." ".$datemail_authorized2;
		
	  $datemail_requestUser1 =date('Y-m-d', strtotime($datemail_requestUser));
	  $datemail_requestUser2 = date('H:i:s', strtotime($datemail_requestUser));
	  $datemail_requestUser3 = $datemail_requestUser1." ".$datemail_requestUser2;

	  $datemail_staffIT1 =date('Y-m-d', strtotime($datemail_staffIT));
	  $datemail_staffIT2 = date('H:i:s', strtotime($datemail_staffIT));
	  $datemail_staffIT3 = $datemail_staffIT1." ".$datemail_staffIT2;

	  $datemail_authorizedCon1 =date('Y-m-d', strtotime($datemail_authorizedCon));
	  $datemail_authorizedCon2 = date('H:i:s', strtotime($datemail_authorizedCon));
	  $datemail_authorizedCon3 = $datemail_authorizedCon1." ".$datemail_authorizedCon2;

	  $datemail_supervisor1 =date('Y-m-d', strtotime($datemail_supervisor));
	  $datemail_supervisor2 = date('H:i:s', strtotime($datemail_supervisor));
	  $datemail_supervisor3 = $datemail_supervisor1." ".$datemail_supervisor2;


		$sql13 = "UPDATE  `db_itmanager`.`mail` SET  `mail_authorized` =  'Accept',
				`mail_authorizedDate` =  '$datemail_authorized3',
				`mail_requestUser` =  'Accept',
				`mail_requestUserDate` =  ' $datemail_requestUser3',
				`mail_staffIT` =  'Accept',
				`mail_staffITdate` =  ' $datemail_staffIT3',
				`mail_authorizedCon` =  'Accept',
				`mail_authorizedConDate` =  '$datemail_authorizedCon3',
				`mail_supervisor` =  'Accept',
				`mail_supervisorDate` =  '$datemail_supervisor3' WHERE  `mail`.`mail_id` ='$mail_id' ; ";
		$rsUpdate13=mysql_query($sql13);  
		if($rsUpdate13){
		echo "<script language='javascript'>
			   alert('Update Complete');
			   setTimeout(\"parent.$.fancybox.close()\",1000); 
			  </script>";
		 echo "<meta http-equiv='refresh' content='1; url=recordPerson.php'>";
		}

?>